<?php

/**
 * Contact form base class.
 *
 * @method Contact getObject() Returns the current form's model object
 *
 * @package    erpcrm
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseContactForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'iden'             => new sfWidgetFormInputHidden(),
      'list_name'        => new sfWidgetFormInputText(),
      'first_name'       => new sfWidgetFormInputText(),
      'last_name'        => new sfWidgetFormInputText(),
      'middle_name'      => new sfWidgetFormInputText(),
      'company_name'     => new sfWidgetFormInputText(),
      'contact_category' => new sfWidgetFormInputText(),
      'address'          => new sfWidgetFormTextarea(),
      'city'             => new sfWidgetFormInputText(),
      'phone'            => new sfWidgetFormInputText(),
      'fax'              => new sfWidgetFormInputText(),
      'email'            => new sfWidgetFormInputText(),
      'country_name'     => new sfWidgetFormPropelChoice(array('model' => 'ListCountries', 'add_empty' => false, 'key_method' => 'getName')),
      'salutation'       => new sfWidgetFormInputText(),
      'name_suffix'      => new sfWidgetFormInputText(),
      'birthday'         => new sfWidgetFormDate(),
      'remarks'          => new sfWidgetFormTextarea(),
      'founding_day'     => new sfWidgetFormDate(),
      'website'          => new sfWidgetFormInputText(),
      'zip_code'         => new sfWidgetFormInputText(),
      'company_initials' => new sfWidgetFormInputText(),
      'cellphone'        => new sfWidgetFormInputText(),
      'pobox'            => new sfWidgetFormInputText(),
      'telex'            => new sfWidgetFormInputText(),
      'person_position'  => new sfWidgetFormInputText(),
      'status'           => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'iden'             => new sfValidatorPropelChoice(array('model' => 'Contact', 'column' => 'iden', 'required' => false)),
      'list_name'        => new sfValidatorString(array('max_length' => 200)),
      'first_name'       => new sfValidatorString(array('max_length' => 50)),
      'last_name'        => new sfValidatorString(array('max_length' => 50)),
      'middle_name'      => new sfValidatorString(array('max_length' => 50)),
      'company_name'     => new sfValidatorString(array('max_length' => 100)),
      'contact_category' => new sfValidatorString(array('max_length' => 30)),
      'address'          => new sfValidatorString(),
      'city'             => new sfValidatorString(array('max_length' => 50)),
      'phone'            => new sfValidatorString(array('max_length' => 50)),
      'fax'              => new sfValidatorString(array('max_length' => 50)),
      'email'            => new sfValidatorString(array('max_length' => 50)),
      'country_name'     => new sfValidatorPropelChoice(array('model' => 'ListCountries', 'column' => 'name')),
      'salutation'       => new sfValidatorString(array('max_length' => 10)),
      'name_suffix'      => new sfValidatorString(array('max_length' => 10)),
      'birthday'         => new sfValidatorDate(array('required' => false)),
      'remarks'          => new sfValidatorString(),
      'founding_day'     => new sfValidatorDate(array('required' => false)),
      'website'          => new sfValidatorString(array('max_length' => 50)),
      'zip_code'         => new sfValidatorString(array('max_length' => 10)),
      'company_initials' => new sfValidatorString(array('max_length' => 20)),
      'cellphone'        => new sfValidatorString(array('max_length' => 50)),
      'pobox'            => new sfValidatorString(array('max_length' => 20)),
      'telex'            => new sfValidatorString(array('max_length' => 20)),
      'person_position'  => new sfValidatorString(array('max_length' => 50)),
      'status'           => new sfValidatorString(array('max_length' => 10)),
    ));

    $this->widgetSchema->setNameFormat('contact[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Contact';
  }


}
